#pragma once
#include <protocolProcesser.h>
#include <deviceParameter.h>

#pragma pack(1)
struct masterStructSetAddressBySN
{
    uint8_t setSn[DEVICE_SERIAL_NUMBER_SIZE];
    uint8_t setaddr;
};

struct deviceStructSetAddressBySN
{
    uint8_t responseVersion[38];
    uint8_t responseSn[DEVICE_SERIAL_NUMBER_SIZE];
    uint8_t responseAddr;
    uint8_t deviceType;
};
#pragma pack()

#if COMMAND_MASTER_CALL_DEFINE
int masterCallbackSetAddressBySN(void *inputstring, uint32_t *inputsize, void *userdata);
int masterWaitResponseSetAddressBySN(struct protocolProcessorInform *processer, struct masterStructSetAddressBySN *indata,
                                  uint16_t insize, uint8_t devaddr);
#endif
#if COMMAND_DEVICE_CALL_DEFINE
int deviceCallbackSetAddressBySN(void *inputstring, uint32_t *inputsize, void *userdata);
#endif
